<template>
  <div class="container" style="margin-bottom:50px">
    <p class="title">订单详情 <el-button type="primary" class="btn" @click="$router.back()">返回</el-button></p>
    <el-form ref="form" label-width="80px" style="width: 80%">
      <el-form-item label="订单信息">
        <label for="">订单编号: </label> <span>{{ info.orderNo }}</span> <br>
        <label for="">创建时间: </label><span>{{ info.orderCreateTime }}</span><br>
        <label for="">平台: </label><span v-if="info.application">{{ info.application=='00'?'ebroker':'车E家' }}</span>
      </el-form-item>
      <el-form-item label="支付信息">
        <label for="">支付方式: </label> <span>{{ ['支付宝','微信'][info.payWay] }}</span> <br>
        <label for="">消费金额: </label><span>{{ info.amount }}</span><br>
        <label for="">支付订单号: </label><span>{{ info.thirdTradeNo }}</span><br>
        <label for="">支付时间: </label><span>{{ info.payTime }}</span><br>
      </el-form-item>
      <el-form-item label="报告信息">
        <label for="">报告状态: </label><span>{{ ['查无报告','查询中','已生成报告'][info.status] }}</span> <br>
        <label for="">报告详情: </label><span style="color:#00f;cursor: pointer;" @click="dialogVisible=true">查看报告</span><br>
        <label for="">报告生成时间: </label><span>{{ info.reportCreateTime }}</span><br>
      </el-form-item>
      <el-form-item label="车辆信息">
        <label for="">VIN: </label> <span>{{ info.vin }}</span> <br>
        <label for="">行驶证: </label><span>
          <!-- <img style="width:100px;height:60px" :src="info.drivingLicenceUrl"> -->
          <el-image
            v-if="info.drivingLicenceUrl"
            style="width: 100px; height: 60px;vertical-align: top;"
            :src="info.drivingLicenceUrl"
            :preview-src-list="[info.drivingLicenceUrl]"
          />

        </span><br>
      </el-form-item>
      <el-form-item label="用户信息">
        <label for="">用户ID: </label> <span>{{ info.userId }}</span> <br>
        <label for="">用户身份: </label><span>{{ ['普通用户', '经纪人', '城市合伙人','品牌合伙人'][info.roleType] }}</span><br>
      </el-form-item>
      <el-form-item v-if="info.refundTime" label="退款信息">
        <label for="">退款方式: </label> <span>{{ ['支付宝','微信'][info.refundWay] }}</span> <br>
        <label for="">退款时间: </label><span>{{ info.refundTime }}</span><br>
        <label for="">退款金额: </label><span>{{ info.refundAmount }}</span><br>
        <label for="">退款订单号: </label><span>{{ info.refundOrderNo }}</span><br>
      </el-form-item>
    </el-form>
    <Dialog :id="lookId" :visibles="dialogVisible" @fnClose="myclose" />
  </div>
</template>

<script>
import Dialog from './dialog.vue'
export default {
  components: {
    Dialog
  },
  data() {
    return {
      info: {},
      lookId: 0,
      dialogVisible: false
    }
  },
  created() {
    this.lookId = Number(this.$route.query.id)
    this.$get(`/web/carVinReport/getOrderDetail?id=${this.lookId}`).then(res => {
      if (res.data.code === '0') {
        console.log(res.data.data)
        this.info = res.data.data
      }
    })
  },
  methods: {
    myclose() {
      this.dialogVisible = false
    }
  }
}
</script>
<style lang="scss" scoped>
.container {
  .el-form-item {
    /deep/ .el-form-item__label {
      font-weight: 700 !important;
    }
  }

  width: 80%;
  margin: 0 auto;
  .title {
    position: relative;
    height: 80px;
    font-size: 24px;
    line-height: 80px;
    text-align: center;
    .btn{
      position: absolute;
      right: 0;
      top: 25px;
    }
  }
  label {
    width: 200px;
    display: inline-block;
    text-align: center;
  }
}
</style>
